<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:c="http://java.sun.com/jsp/jstl/core"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui"
      xmlns:ui="http://java.sun.com/jsf/facelets">
    <h:head>

        <meta http-equiv="content-type" content="text/html; charset=utf-8" />
        <title>BANCO DE IMAGENS CEFALOMÉTRICAS - APPLET</title>
        <meta name="keywords" content="" />
        <meta name="description" content="" />
        <link href="Layout.css" rel="stylesheet" type="text/css" media="screen" />


    </h:head>
    <f:view>
            <f:event type="preRenderView" listener="#{userBean.isCadastrado}"/>
        </f:view>
    <div id="header">
        <div id="msgLogin">
            <h:outputText rendered="#{userBean.logado}" value="Olá, #{userBean.nome}"></h:outputText>
        </div>
        <ui:include src="campologin.xhtml"></ui:include>
    </div>
    <div id="subcorpo2">
        <div id="barradivisora"></div>
        <ui:include src="menuhorizontal.xhtml"></ui:include>
        <br></br><br></br>
        <body>
            <f:view contentType="text/html">
                <f:event type="preRenderView" listener="#{pacBean.popularPacientes}"/>
            </f:view>
            <div id="campos">
                <h4>Galeria de Imagens</h4>
                <div id="barraTitulo"></div><br></br>
                <div id="galeria">

                    <p:carousel value="#{pacBean.pacientes}" itemStyle="height:760px;width:610px;" rows="1" var="paciente">
                        <h:panelGrid columns="1" cellpadding="5">
                            <p:graphicImage value="/imagensPaciente/#{paciente.urlReduzida}">
                                <f:param id="paciente" name="paciente" value="#{paciente.id}" />
                            </p:graphicImage>
                            <h:outputText value="Nº da imagem: #{paciente.id}" />
                            <h:outputText value="Idade: #{paciente.idade}" />
                            <h:outputText value="Sexo: #{paciente.sexoreal}" />
                            <h:outputText value="Raça: #{paciente.racareal}" />
                        </h:panelGrid>
                    </p:carousel>
                </div>
                <br></br><br></br>

            </div>
            <div id="galeria">
                <h:form>
                    <h:selectOneMenu value="#{pacBean.opcaoImagem}">
                        <f:selectItems value="#{pacBean.pacientes}" var="paciente" itemLabel="Imagem Nº #{paciente.id}" itemValue="#{paciente.id}" />
                    </h:selectOneMenu>
                    <h:commandButton  value="DOWNLOAD" action="#{pacBean.downloadFile}"/>
                </h:form>

                <br></br><br></br>
                <h:form>
                        <div id="barraTitulo"></div><br></br>
                        <h4>Filtre as imagens por idade:</h4>
                         <h:outputText value=" De: "></h:outputText>
                         <h:inputText style="width: 15px;" value="#{pacBean.filtroidadeinicial}"></h:inputText>
                         <h:outputText value=" a: "></h:outputText>
                         <h:inputText style="width: 15px;" value="#{pacBean.filtroidadefinal}"></h:inputText>
                         <h4>Filtre as imagens por raça:</h4>
                         <h:selectOneRadio value="#{pacBean.filtroraca}">
                            <f:selectItem itemValue="4" itemLabel="Sem filtro" />
                            <f:selectItem itemValue="3" itemLabel="Negra" />
                            <f:selectItem itemValue="2" itemLabel="Parda" />
                            <f:selectItem itemValue="1" itemLabel="Branca" />
                            <f:selectItem itemValue="0" itemLabel="Amarela" />
                        </h:selectOneRadio>

                         <br></br>
                        <h:commandButton  value="FILTRAR" action="#{pacBean.filtrar}"/><h:commandButton  value="RESETAR" action="#{pacBean.resetar}"/>
                </h:form>
            </div>
        </body>


        <div id="footer"><div id="sign"><p>Copyright &copy; 2012 BANCO DE IMAGENS. Developed by BDIPA Ltda.</p></div></div>
    </div>
</html>


